package com.bjc.feign.fallback;

import com.bjc.domain.Product;
import com.bjc.feign.ProductFeignClient;
import org.springframework.stereotype.Service;

/**
 * @program: spring-cloud-alibaba
 * @description: 容错类
 * @author: bjc
 * @create: 2021-08-04 22:17
 */
@Service
public class ProductServiceFallback implements ProductFeignClient {


    @Override
    public Product findByPid(Integer pid) {
        //容错逻辑
        Product product = new Product();
        product.setPid(-100);
        product.setPname("远程调用商品服务出现异常，进入了容错逻辑");
        return product;
    }
}
